<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<!--{hook admin_content_start.htm}-->

<div class="container-fluid">
    <div class="row">
        <div class="col-lg-12">
            <!--{hook admin_content_breadcrumb_before.htm}-->
            <?php if(empty($hide_breadcrumb)) { ?>
            <ol class="breadcrumb d-none d-md-flex text-muted border-left-primary">
                <li class="breadcrumb-item"><a href="<?php echo url($route.'-list','', TRUE);?>"><i class="icon-home text-primary" aria-hidden="true"></i></a></li>
                <li class="breadcrumb-item"><?php echo lang($route);?></li>
                <?php if ($fid) { ?>
                <li class="breadcrumb-item"><a href="<?php echo url('content-list', array('fid'=>$fid), TRUE);?>"><?php echo $forum['name'];?></a></li>
                <?php } ?>
                <li class="breadcrumb-item"><?php echo lang('list');?></li>
                <!--{hook admin_content_breadcrumb.htm}-->
            </ol>
            <?php } ?>
            <!--{hook admin_content_breadcrumb_after.htm}-->
            <div class="card">
                <div class="card-body">
                    <div class="d-flex justify-content-between mb-3">
                        <!--{hook admin_content_menu_start.htm}-->
                        <div>
                            <select class="custom-select mr-1 w-auto" name="fid">
                                <!--{hook admin_content_select_strat.htm}-->
                                <option value="0"><?php echo 'sticky'==$route?lang('top_3'):lang('select'); ?></option>
                                <!--{hook admin_content_select_before.htm}-->
                                <?php if(!empty($columnlist)){foreach ($columnlist as $v) { ?>
                                <option value="<?php echo $v['fid']; ?>"><?php echo $v['name']; ?></option>
                                <?php }} ?>
                                <!--{hook admin_content_select_end.htm}-->
                            </select>
                        </div>
                        <!--{hook admin_content_rank_before.htm}-->
                        <!--<?php if (!empty($forum['thread_rank'])) { ?>
                        <div>
                            <?php echo form_radio('thread_rank', array(lang('desc'), lang('rank')), $orderby);?>
                        </div>
                        <?php } ?>-->
                        <!--{hook admin_content_rank_after.htm}-->
                        <div>
                            <?php if (empty($columnlist)) { ?>
                            <a class="btn btn-danger btn-sm" href="<?php echo url('column-list','',TRUE);?>"><?php echo lang('create').lang('column'); ?></a>
                            <?php } else { ?>
                            <a class="btn btn-danger btn-sm" href="<?php echo url('content-create', array('fid'=>$fid), TRUE);?>"><?php echo lang('increase').lang('content'); ?></a>
                            <?php } ?>
                        </div>
                        <!--{hook admin_content_menu_end.htm}-->
                    </div>
                    <ul class="list-unstyled threadlist mb-0">
                        <!--{hook admin_content_threadlist_before.htm}-->
                        <?php include _include(ADMIN_PATH.'view/htm/thread_list.inc.htm');?>
                        <!--{hook admin_content_threadlist_after.htm}-->
                    </ul>
                </div>
            </div>

            <?php include _include(APP_PATH.'view/htm/thread_list_mod.inc.htm');?>

            <!--{hook admin_content_page_before.htm}-->
            <?php if ($pagination) { ?>
            <nav class="my-1"><ul class="pagination justify-content-center flex-wrap"><?php echo $pagination; ?></ul></nav>
            <?php } ?>
            <!--{hook admin_content_page_after.htm}-->
        </div>
    </div>
</div>

<!--{hook admin_content_end.htm}-->

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
    $('.mod-button button').each(function () {
        var modal_url = $(this).attr('data-modal-url');
        if (url_rewrite_on < 2) $(this).attr('data-modal-url', '../' + modal_url);
    });

    var select = $('select[name="fid"]');
    select.val(<?php echo $fid;?>);
    select.change(function () {
        var fid = $(this).val();
        <?php if ('content' == $route) { ?>
            window.location = xn.url('content-list', {fid:fid}, true);
        <?php } elseif ('sticky' == $route) { ?>
            window.location = xn.url('sticky-list', {fid:fid}, true);
        <?php } ?>
        <!--{hook admin_content_jump_by_fid.htm}-->
    });

    $('#content').addClass('show');
    $('li.content, .menu-<?php echo $route;?>').addClass('active').find('a').removeClass('collapsed');
</script>

<!--{hook admin_content_js.htm}-->